<ion-view view-title="我的求购" class="mypbuy_edit">
	<ion-nav-bar ng-class="baseclass">
		<ion-nav-back-button></ion-nav-back-button>
	</ion-nav-bar>
	
    <ion-content>
        <div class="list">
            <li class="item item-input">
                <span class="input-label">标题：</span>
                <input type="text" placeholder="请输入标题" ng-model="input.title" />
            </li>
            <li class="item item-input" ion-datetime-picker title="'请输入结束时间'" ng-model="input.end_time">
                <span class="input-label">结束时间：</span>
                <input type="text" placeholder="请输入结束时间" readonly="" class="timeLight" ng-class="{'timeNoneInfo':input.end_time}">{{input.end_time|
                date: "yyyy-MM-dd H:mm:ss"}}</input>
            </li>

            <li class="item item-input">
                    地区：
                    <div class="input-value small" ng-click="doSelectProvince()">{{input.province.name}}</div>
                    <div class="input-value small" ng-click="doSelectCity()">{{input.city.name}}</div>
                    <div class="input-value small" ng-click="doSelectDistrict()">{{input.district.name}}</div>
                <!--<i class="icon ion-plus-circled positive font-1rem-my" on-tap="input_region_data()"></i>&nbsp;-->
            </li>
            <li class="item item-toggle">
                	能否索要发票：
                <label class="toggle toggle-positive">
           	  	<input type="checkbox" ng-model="input.isHide" >
	             <div class="track">
	               <div class="handle"></div>
	             </div>
	          </label>
            </li>
            <div ng-show="input.isHide">
                <!--当确认索要发票时，才显示-->
                <li class="item item-input-inset" style="padding-bottom: 0;">
                	发票要求：
                    <label class="checkbox checkbox-square padding-0">
    		 			<input type="checkbox" id="add_fp" ng-click="getInvoice_type(1)" ng-model="input.add_fp" />
    		 		</label><label for="add_fp">增值税专用发票</label>
                </li>
                <li class="item item-input-inset item-borderless">
                    <span class="invisible">发货要求：</span>
                    <label class="checkbox checkbox-square padding-0">
    		 		<input type="checkbox" id="normal_fp"  ng-click="getInvoice_type(2)"  ng-model="input.normal_fp"/>
    		 	</label><label for="normal_fp">增值税普通发票</label>
                </li>
            </div>

            <li class="item item-input">
                <span class="input-label">联系方式：</span>
                <input type="text" placeholder="请输入联系方式" ng-model="input.phone" />
            </li>
            <li class="item item-input">
                需求说明：
                <textarea rows="3" placeholder="请输入求购详情" ng-model="input.memo"></textarea>
            </li>

            <!--增加商品-->
            <li class="item item-divider item-icon-right">
                求购商品
                <i class="icon ion-plus-circled positive" on-tap="addGoods()"></i>
            </li>
            <li class="item item-input">
                <span class="input-label">商品名称：</span>
                <input type="text" placeholder="请输入商品名称" ng-model="goods.name" />
            </li>
            <li class="item" style="padding: 6px 0 5px 16px;">
                   	品牌：<input type="radio" value="0" name="brand" id="notNamedBrand" ng-model="goods.brand_need"/><label for="notNamedBrand">不指定</label>
            </li>
            <li class="item item-borderless" style="padding: 6px 0 5px 16px;line-height: 30px;">
                <span class="invisible">品牌：</span><input type="radio" name="brand" value="1" id="namedBrand" ng-model="goods.brand_need"/><label for="namedBrand">指定</label>
                <input type="text" placeholder="请输入指定的品牌" ng-show="goods.brand_need" class="right-zhang stable-bg" style="height:28px;width: 65%;padding-left: 3px;" ng-model="goods.brand_name"/>
            </li>
            <li class="item item-input">
                    品类：
                    <div class="input-value small" ng-click="doSelectCat1()">{{input.cat1.name}}</div>
                    <div class="input-value small" ng-click="doSelectCat2()">{{input.cat2.name}}</div>
                    <div class="input-value small" ng-click="doSelectCat3()">{{input.cat3.name}}</div>
            </li>
            <li class="item item-input">
                <span class="input-label">采购量：</span>
                <input type="text" placeholder="请输入商品采购量" ng-model="goods.count" />
            </li>
            <li class="item item-input">
                <span class="input-label">商品单位：</span>
                <input type="text" placeholder="请输入商品单位" ng-model="goods.unit" />
            </li>
            <li class="item item-input">
                商品描述：
                <textarea rows="3" placeholder="请输入商品描述" ng-model="goods.describe"></textarea>
            </li>
            <li class="item item-input">
                <span class="input-label">商品图片：</span>
                <a class="add input-file" href="javascript:void(0);"><span class="icon ion-plus" on-tap="addStoreImg()"></span></a>
            </li>
            <li class="item padding-0" ng-if="showImg.image">
                <div class="imageShow">
                    <img src="{{showImg.image}}" on-tap="openFileActSheet()">
                </div>
            </li>
            <li class="item item-divider royal" ng-if="input.goodsArray.length">已添加的商品</li>
            <li class="item padding-10 font-large-my" ng-repeat="g in input.goods track by $index">
                {{g.name}}
                <span class="right-zhang  font-1rem-my"><i class="icon ion-close-circled assertive" on-tap="deleteAlreadyGoods($index)"></i><i class="icon ion-compose positive margin-left-10-my" on-tap="editAlreadyGoods($index)"></i></span>
            </li>
        </div>

        <div class="button-bar padding">
            <button class="button  button-assertive" on-tap="tui()">取消</button>
            <button class="button  button-positive col-offset-10" on-tap="save()">保存</button>
        </div>

    </ion-content>
</ion-view>